package com.itheima.domain;



public class User {
    private String name;
    private Integer age;

    public static Builder builder(){
        return new Builder();
    }

    static class Builder{
        private String name;
        private Integer age;

        public String getName() {
            return name;
        }

        public Builder setName(String name) {
            this.name = name;
            return this;
        }

        public Integer getAge() {
            return age;
        }

        public Builder setAge(Integer age) {
            this.age = age;
            return this;
        }
        public User build(){
            User user=new User();
            user.setName(name);
            user.setAge(age);
            return user;
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public static void main(String[] args) {
        User data = User.builder().setAge(12).setName("asda").build();
    }
}
